package com.wish.building.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;

/**
 * 物业类型
 * @author 刘郑欣
 *
 */
public enum PremisesType {
    NORMALHOUSE("普通住宅", 0),
    APARTMENT("公寓", 1),
    COMMERCIALANDRESIDENTIAL("商住两用", 2),
    COMMERCIALESTATE("商业地产", 3),
    OFFICEBUILDING("写字楼", 4);

    @EnumValue
    private String name;
    private int index;

    private PremisesType(String name, int index) {
        this.name = name;
        this.index = index;
    }
    // 普通方法
    public static String getName(int index) {
        for (PremisesType c : PremisesType.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getIndex() {
        return index;
    }
    public void setIndex(int index) {
        this.index = index;
    }
}
